FROM registry.cn-hangzhou.aliyuncs.com/library/openjdk:17-jdk-slim

WORKDIR /app

# 安装Maven
RUN apt-get update && apt-get install -y maven && rm -rf /var/lib/apt/lists/*

# 复制pom.xml和源代码
COPY pom.xml .
COPY src ./src

# 构建应用
RUN mvn clean package -DskipTests

# 暴露端口
EXPOSE 8080

# 启动命令
CMD ["java", "-jar", "target/smartresume-backend-1.0.0.jar"]